<?php

if (!defined('IN_PROVERB')) {
    exit('Access Denied');
}
?>

<?php include ROOT_PATH . '/views/admin/header.php'; ?>

<body>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <A HREF="index.php?con=<?php echo $GLOBALS['setting']['adminpath']; ?>&act=dangyuan"><em>全部</em></A>
    </div>
</div>


<div id="man_zone">
    <form action="index.php?con=<?php echo $GLOBALS['setting']['adminpath']; ?>&act=dangyuanmodify" method="post"
          onsubmit="return checkform(this);">
        <INPUT TYPE="hidden" NAME="commit" value="1">
        <INPUT TYPE="hidden" NAME="updateid" value="<?php echo $dangyuan['user_id']; ?>">
        <table width="90%" class="table_form">
            <tbody>

            <tr height="50">
                <td width="80">党员姓名</td>
                <td>
                    <input type="text" id="dangyuan_title" value="<?php echo $dangyuan['user_name']; ?>"
                           class="input-text"
                           name="user_name" style="width:450px; height: 30px;">

                </td>
            </tr>

            <tr height="50">
                <td width="80">党员积分</td>
                <td>
                    <input type="text" id="jifen_title" value="<?php echo $dangyuan['jifen']; ?>"
                           class="input-text"
                           name="jifen" style="width:450px; height: 30px;">

                </td>
            </tr>

            <tr height="50">
                <td width="80" class="asdasd">岗位名称</td>
                <td>
                    <INPUT TYPE="hidden" id="gangwei_name" NAME="gangwei" value="<?php echo $dangyuan['gangwei']; ?>">
                    <select name="gid" id="id_gangwei" style="width:450px; height: 30px;">
                        <?php
                        for ($i = 0; $i < count($gangwei); $i++) {
                            if ($dangyuan['gid'] == $gangwei[$i]['gid']) {
                                echo "<option
                            value='" . $gangwei[$i]['gid'] . "' selected>" . $gangwei[$i]['gname'] . "</option>";
                            } else {
                                echo "<option
                            value='" . $gangwei[$i]['gid'] . "'>" . $gangwei[$i]['gname'] . "</option>";
                            }

                        }

                        ?>
                    </select>

                </td>
            </tr>

            <tr>
                <td></td>
                <td>


                    <INPUT TYPE="submit" class="normal_button" onclick="checkIt()"
                           style="width: 100px; height: 50px; background-color: #D54E21; color: #fff; font-size: medium"
                           value="提交">
                </td>
            </tr>
            </tbody>
        </table>
    </FORM>
</div>

<script type="text/javascript">

    function checkIt() {
        if ($('#dangyuan_title').val() == '') {
            alert('岗位名称不能为空');
            return false;
        }
        return true;
    }

    $('#id_gangwei').change(function () {
        var value = $(this).children('option:selected').html();
        $("#gangwei_name").val(value);
    })


</script>

</body>
</html>
